package cn.aspart.api_logger.controller;

import cn.aspart.api_logger.pojo.AnimalReq;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping(path = "/api/demo")
public class DemoController {

    @PostMapping(path = "/add")
    public Object add(@RequestParam(name = "id") Long id,
                      @RequestBody @Validated AnimalReq req) {
        req.setId(id);
        return req;
    }

}
